﻿<controls:ChildWindow
    x:Class="TimelineEx.EditEventWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls"
    xmlns:me="clr-namespace:TimelineEx;assembly=TimelineExLib"
    xmlns:timeline="clr-namespace:TimelineLibrary;assembly=TimelineLibrary"
    TextOptions.TextHintingMode="Animated"
    Width="529.208"
    Height="415"
    Title="Edit Event"
    xmlns:inputToolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Input.Toolkit">
    
    <Grid
        x:Name="LayoutRoot"
        Margin="2">
        
        <Grid.Resources>

            <me:BoolToVisibilityConverter
                x:Key="BoolToVisibilityConverter" />

            <timeline:NullToUnsetConverter
                x:Key="NullToUnsetConverter"></timeline:NullToUnsetConverter>

        </Grid.Resources>
        
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition
                Height="Auto" />
        </Grid.RowDefinitions>

        <Grid
            Grid.Row="1"
            VerticalAlignment="Center"
            HorizontalAlignment="Stretch">

            <Grid.ColumnDefinitions>
                <ColumnDefinition
                    Width="*"></ColumnDefinition>
                <ColumnDefinition
                    Width="Auto"></ColumnDefinition>
            </Grid.ColumnDefinitions>

            <StackPanel
                Grid.Column="1"
                Orientation="Horizontal">
                <Button
                    x:Name="SaveButton"
                    Content="Save"
                    Click="SaveClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />

                <Button
                    x:Name="DeleteButton"
                    Content="Delete"
                    Click="DeleteClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />

                <Button
                    x:Name="CancelButton"
                    Content="Cancel"
                    Click="CancelClick"
                    Width="75"
                    Height="23"
                    Margin="5"
                    HorizontalAlignment="Right"
                    Grid.Row="1" />
            </StackPanel>
        </Grid>
        
        <TextBlock
            x:Name="lblTitle"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,16,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Title:"/>
        
        <TextBox
            x:Name="title"
            Height="24"
            Margin="116,12,17,0"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Title, Mode=TwoWay}"
            VerticalAlignment="Top" />
        
        <TextBlock
            x:Name="lblDescription"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,49,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Description:"/>
        
        <TextBox
            x:Name="description"
            Height="24"
            Margin="116,45,17,0"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Description, Mode=TwoWay}"
            VerticalAlignment="Top" />
        
        <CheckBox
            Content="Has Duration"
            Height="24"
            x:Name="hasDuration"
            Margin="116,87,17,0"
            VerticalAlignment="Top"
            IsChecked="{Binding EditEvent.IsDuration, Mode=TwoWay}" />
        
        <TextBlock
            x:Name="lblStartDate"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,122,0,0"
            TextWrapping="Wrap"
            VerticalAlignment="Top"
            Width="112"
            TextAlignment="Right"
            Text="Start Date Time:"/>
        
        <controls:DatePicker
            x:Name="startDate"
            HorizontalAlignment="Left"
            Height="23"
            Margin="116,117,0,0"
            VerticalAlignment="Top"
            SelectedDate="{Binding StartDate, Mode=TwoWay}"
            Width="127" />

        <inputToolkit:TimePicker
            Height="22"
            HorizontalAlignment="Left"
            Margin="252,117,0,0"
            Name="timePicker1"
            Value="{Binding StartTime, Mode=TwoWay}"
            VerticalAlignment="Top" />

        <TextBlock
            x:Name="lblEndDate"
            HorizontalAlignment="Left"
            Margin="0,160,0,165"
            TextWrapping="Wrap"
            Width="112"
            Visibility="{Binding EditEvent.IsDuration, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
            TextAlignment="Right"
            Text="End Date Time:"/>
        
        <controls:DatePicker
            x:Name="endDate"
            HorizontalAlignment="Left"
            SelectedDate="{Binding EndDate, Mode=TwoWay}"
            Margin="116,155,0,165"
            Visibility="{Binding EditEvent.IsDuration, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
            Width="127" />

        <inputToolkit:TimePicker
            Height="22"
            HorizontalAlignment="Left"
            Margin="252,155,0,0"
            Name="timePicker2"
            Value="{Binding EndTime, Mode=TwoWay}"
            Visibility="{Binding EditEvent.IsDuration, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}"
            VerticalAlignment="Top" />
        
        <TextBlock
            x:Name="lblImage"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,124"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            TextAlignment="Right"
            Text="Image:" />
        
        <TextBox
            x:Name="image"
            Height="24"
            Margin="116,0,17,122"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.EventImage, Converter={StaticResource NullToUnsetConverter}, Mode=TwoWay}"
            VerticalAlignment="Bottom" />
        
        <TextBlock
            x:Name="lblTeaserImage"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,85"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            Text="Teaser Image"
            TextAlignment="Right"/>
        
        <TextBox
            x:Name="teaserImage"
            Height="24"
            Margin="116,0,17,83"
            TextWrapping="Wrap"
            Text="{Binding Path=EditEvent.TeaserEventImage, Converter={StaticResource NullToUnsetConverter}, Mode=TwoWay}"
            VerticalAlignment="Bottom" />
        
        <TextBlock
            x:Name="lblVideo"
            HorizontalAlignment="Left"
            Height="18"
            Margin="0,0,0,46"
            TextWrapping="Wrap"
            VerticalAlignment="Bottom"
            Width="112"
            TextAlignment="Right"
            Text="Video:"/>
        
        <TextBox
            x:Name="video"
            Height="24"
            Margin="116,0,17,44"
            TextWrapping="Wrap"
            Text="{Binding EditEvent.Video, Mode=TwoWay}"
            VerticalAlignment="Bottom" />
    </Grid>
</controls:ChildWindow>